<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
    window.addEventListener('deviceorientation', function (e) {
        console.log(e.absolute)
        console.log(e.alpha)
        console.log(e.beta)
        console.log(e.gamma)
    });
</script>